/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author TimoR
 */
@Entity
@Table(name = "votings")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Votings.findAll", query = "SELECT v FROM Votings v"),
    @NamedQuery(name = "Votings.findById", query = "SELECT v FROM Votings v WHERE v.id = :id"),
    @NamedQuery(name = "Votings.findByFrage", query = "SELECT v FROM Votings v WHERE v.frage = :frage"),
    @NamedQuery(name = "Votings.findByCreated", query = "SELECT v FROM Votings v WHERE v.created = :created"),
    @NamedQuery(name = "Votings.findByAnswer1", query = "SELECT v FROM Votings v WHERE v.answer1 = :answer1"),
    @NamedQuery(name = "Votings.findByAnswers1", query = "SELECT v FROM Votings v WHERE v.answers1 = :answers1"),
    @NamedQuery(name = "Votings.findByAnswer2", query = "SELECT v FROM Votings v WHERE v.answer2 = :answer2"),
    @NamedQuery(name = "Votings.findByAnswers2", query = "SELECT v FROM Votings v WHERE v.answers2 = :answers2"),
    @NamedQuery(name = "Votings.findByAnswer3", query = "SELECT v FROM Votings v WHERE v.answer3 = :answer3"),
    @NamedQuery(name = "Votings.findByAnswers3", query = "SELECT v FROM Votings v WHERE v.answers3 = :answers3"),
    @NamedQuery(name = "Votings.findByAnswer4", query = "SELECT v FROM Votings v WHERE v.answer4 = :answer4"),
    @NamedQuery(name = "Votings.findByAnswers4", query = "SELECT v FROM Votings v WHERE v.answers4 = :answers4"),
    @NamedQuery(name = "Votings.findByAnswer5", query = "SELECT v FROM Votings v WHERE v.answer5 = :answer5"),
    @NamedQuery(name = "Votings.findByAnswers5", query = "SELECT v FROM Votings v WHERE v.answers5 = :answers5"),
    @NamedQuery(name = "Votings.findByAnswer6", query = "SELECT v FROM Votings v WHERE v.answer6 = :answer6"),
    @NamedQuery(name = "Votings.findByAnswers6", query = "SELECT v FROM Votings v WHERE v.answers6 = :answers6"),
    @NamedQuery(name = "Votings.findByAnswer7", query = "SELECT v FROM Votings v WHERE v.answer7 = :answer7"),
    @NamedQuery(name = "Votings.findByAnswers7", query = "SELECT v FROM Votings v WHERE v.answers7 = :answers7"),
    @NamedQuery(name = "Votings.findByAnswer8", query = "SELECT v FROM Votings v WHERE v.answer8 = :answer8"),
    @NamedQuery(name = "Votings.findByAnswers8", query = "SELECT v FROM Votings v WHERE v.answers8 = :answers8")})
public class Votings implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "frage")
    private String frage;
    @Basic(optional = false)
    @NotNull
    @Column(name = "created")
    @Temporal(TemporalType.TIMESTAMP)
    private Date created;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer1")
    private String answer1;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers1")
    private int answers1;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer2")
    private String answer2;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers2")
    private int answers2;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer3")
    private String answer3;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers3")
    private int answers3;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer4")
    private String answer4;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers4")
    private int answers4;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer5")
    private String answer5;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers5")
    private int answers5;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer6")
    private String answer6;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers6")
    private int answers6;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer7")
    private String answer7;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers7")
    private int answers7;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "answer8")
    private String answer8;
    @Basic(optional = false)
    @NotNull
    @Column(name = "answers8")
    private int answers8;

    public Votings() {
    }

    public Votings(Integer id) {
        this.id = id;
    }

    public Votings(Integer id, String frage, Date created, String answer1, int answers1, String answer2, int answers2, String answer3, int answers3, String answer4, int answers4, String answer5, int answers5, String answer6, int answers6, String answer7, int answers7, String answer8, int answers8) {
        this.id = id;
        this.frage = frage;
        this.created = created;
        this.answer1 = answer1;
        this.answers1 = answers1;
        this.answer2 = answer2;
        this.answers2 = answers2;
        this.answer3 = answer3;
        this.answers3 = answers3;
        this.answer4 = answer4;
        this.answers4 = answers4;
        this.answer5 = answer5;
        this.answers5 = answers5;
        this.answer6 = answer6;
        this.answers6 = answers6;
        this.answer7 = answer7;
        this.answers7 = answers7;
        this.answer8 = answer8;
        this.answers8 = answers8;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getFrage() {
        return frage;
    }

    public void setFrage(String frage) {
        this.frage = frage;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public String getAnswer1() {
        return answer1;
    }

    public void setAnswer1(String answer1) {
        this.answer1 = answer1;
    }

    public int getAnswers1() {
        return answers1;
    }

    public void setAnswers1(int answers1) {
        this.answers1 = answers1;
    }

    public String getAnswer2() {
        return answer2;
    }

    public void setAnswer2(String answer2) {
        this.answer2 = answer2;
    }

    public int getAnswers2() {
        return answers2;
    }

    public void setAnswers2(int answers2) {
        this.answers2 = answers2;
    }

    public String getAnswer3() {
        return answer3;
    }

    public void setAnswer3(String answer3) {
        this.answer3 = answer3;
    }

    public int getAnswers3() {
        return answers3;
    }

    public void setAnswers3(int answers3) {
        this.answers3 = answers3;
    }

    public String getAnswer4() {
        return answer4;
    }

    public void setAnswer4(String answer4) {
        this.answer4 = answer4;
    }

    public int getAnswers4() {
        return answers4;
    }

    public void setAnswers4(int answers4) {
        this.answers4 = answers4;
    }

    public String getAnswer5() {
        return answer5;
    }

    public void setAnswer5(String answer5) {
        this.answer5 = answer5;
    }

    public int getAnswers5() {
        return answers5;
    }

    public void setAnswers5(int answers5) {
        this.answers5 = answers5;
    }

    public String getAnswer6() {
        return answer6;
    }

    public void setAnswer6(String answer6) {
        this.answer6 = answer6;
    }

    public int getAnswers6() {
        return answers6;
    }

    public void setAnswers6(int answers6) {
        this.answers6 = answers6;
    }

    public String getAnswer7() {
        return answer7;
    }

    public void setAnswer7(String answer7) {
        this.answer7 = answer7;
    }

    public int getAnswers7() {
        return answers7;
    }

    public void setAnswers7(int answers7) {
        this.answers7 = answers7;
    }

    public String getAnswer8() {
        return answer8;
    }

    public void setAnswer8(String answer8) {
        this.answer8 = answer8;
    }

    public int getAnswers8() {
        return answers8;
    }

    public void setAnswers8(int answers8) {
        this.answers8 = answers8;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Votings)) {
            return false;
        }
        Votings other = (Votings) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Votings[ id=" + id + " ]";
    }
    
}
